import javax.swing.*;
import java.awt.*;
import java.util.ArrayList;

public class SuggestPanelInPraise extends FlowPanel {
    Dimension lblSize  = new Dimension(120, 75);
    Dimension tfdSize = new Dimension(240, 75);
    Font font = new Font("Monospaced", Font.PLAIN, 24);
    private ArrayList<JComponent> components = new ArrayList<>();

    private JLabel lblOrderNum = new JLabel("订单号：");
    private JTextField tfdOrderNum = new JTextField();
    private JLabel lblSuggest = new JLabel("建议：");
    private JTextField tfdSuggest = new JTextField();

    {
        components.add(lblOrderNum);
        components.add(tfdOrderNum);
        components.add(lblSuggest);
        components.add(tfdSuggest);

        for (JComponent component: components){
            component.setFont(font);
            if (components.indexOf(component)%2==0){
                component.setPreferredSize(lblSize);
            } else {
                component.setPreferredSize(tfdSize);
            }
            add(component);
        }
        addButton();
    }

    public SuggestPanelInPraise(FlowLayout flowLayout){
        super(flowLayout);
    }

    public JTextField getTfdOrderNum() {
        return tfdOrderNum;
    }

    public JTextField getTfdSuggest() {
        return tfdSuggest;
    }
}
